import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: () => import('@/views/Login.vue')
    },
    {
      path: '/register',
      component: () => import('@/views/Register.vue')
    },
    {
      path: '/',
      component: () => import('@/views/Welcome.vue'),
      meta: { requiresAuth: false } 
    },
    { path: '/appointments', 
      component: () => import('@/views/AppointmentsView.vue'),
      meta: { requiresAuth: true }
    },
    { path: '/ai-chat',
      component: () => import('@/views/AiChat.vue'),
      meta: { requiresAuth: true }
     },
     { path: '/search-cases',
      component: () => import('@/views/SearchCasesView.vue'),
      meta: { requiresAuth: true }
     },
     { path: '/patient-info',
      component: () => import('@/views/PatientInfoView.vue'),
      meta: { requiresAuth: true }
     },
     { path: '/case-statistics',
      component: () => import('@/views/CaseStatisticsView.vue'),
      meta: { requiresAuth: true }
     },
     { path: '/profile',
      component: () => import('@/views/ProfileView.vue'),
      meta: { requiresAuth: true }
     },
  ],
})

export default router
